home *** CD-ROM | disk | FTP | other *** search
- Programming the Sound Blaster DSP in DMA Mode
-
- (Note: All values are hexadecimal. This information was obtained
- from the Book "Sound Blaster The Official Book" ISBN 0-07-881907-05)
-
- 1. Set up the ISR
-
- 2. Program the sampling rate to the DSP
- a. Turn on speaker (write D1 to DSP command register 2xC)
- b. Send the Set-Time Constant command (write 40 to 2xC)
- c. Send the time constant (write byte to DSP command register 2xC)
-
- 3. Program the DMA Controller for the first data block
- a. Select DMA channel 1 by writing 5 to DMA mask register 0A
- b. Reset DMA transfer flip/flop (write 00 to DMA clear byte pointer
- register 0C)
- c. Select DMA mode for DAC output (write 45 to DMA mode register 0B)
- d. Send data memory address to DMA controller (write lo byte to 02
- and hi byte to 02)
- e. Send physical memory page number to DMA controller (write to
- page address register 83)
- f. Send DMA data-byte (data length -1) to ch1 transfer count
- register 03 lo then hi
- g. Enable DMA channel 1 (write 01 to mask register 0A)
-
- 4. Program the DSP for the first data block
- a. Send DMA mode 8-bit DAC command (write 14 to DSP command
- register 2xC)
- b. Send the length-1 of data to be transfered (lo, then hi to 2xC)
-
- 5. Service the DSP Interrupt
- a. Save machine status (registers)
- b. Acknowledge DSP interrupt by reading DSP data available status
- register 2xE
- c. If no more blocks to transfere, goto step 5f
- d. Program the DMA controller for next data block (step 3)
- e. Program DSP for next data block (step 4)
- f. Output End-Of-Interrupt to PIC (execute EOI OUT 20,20)
- g. Restore registers.
- h. execute IRET
-
- 6. Restore original ISR
-